/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wmauswertung;

import java.util.ArrayList;
import java.util.HashMap;

/**
 *
 * @author mcnanuschi
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println("Hier entsteht das Auswertungsprogramm!\n");
        //Create a game - home "GER" & guest "ARG"
        Match Ger_Arg = new Match("Germany", "Argentinia");
        Ger_Arg.scoreFor("home");
        Ger_Arg.scoreFor("guest");
        System.out.println("Uuups! That was wrong...");
        Ger_Arg.setScore(2, 0);
        Ger_Arg.scoreFor("home");
        Ger_Arg.scoreFor("home");

        Ger_Arg.closeGame();

        XMLParser xmlp = new XMLParser();

        ArrayList teamsOfGroupA = (ArrayList) xmlp.getTeamList("A");
        ArrayList teamsOfGroupB = (ArrayList) xmlp.getTeamList("B");

        HashMap ergebnisse = (HashMap) xmlp.getMatchScores("A");

        log("Ergebnisausgabe der gesicherten Spiele:");
        ArrayList scoreT1vsT2 = (ArrayList)ergebnisse.get("team1_vs_team2");
        log(teamsOfGroupA.get(0).toString() + " gegen " + teamsOfGroupA.get(1).toString() + ": " + scoreT1vsT2.get(0).toString() +":"+scoreT1vsT2.get(1).toString());
        log(teamsOfGroupA.get(0).toString() + " gegen " + teamsOfGroupA.get(2).toString() + ": " + ergebnisse.get("team1_vs_team3").toString());
        log(teamsOfGroupA.get(0).toString() + " gegen " + teamsOfGroupA.get(3).toString() + ": " + ergebnisse.get("team1_vs_team4").toString());
//        log(ergebnisse["team1_vs_team2"][0].toString());

/**
 * Test if GUI created by GUI-Builder is running properly
 * Maybe the GUI will become the real main-Class to start project.
 */
        NewJFrameForGUITesting frame = new NewJFrameForGUITesting();
        frame.main(args);
        

//        Hauptsächlich als letzter Breakpoint genutzt
        log("Ende!\n");
    }

    /**
     * Own function to make a console output because i'm to lazy to type it every time ;)
     * The given string will be printed out to console
     * @param String s
     */
    private static void log(String s) {
        System.out.println(s);
    }
}
